package GUI;

import Business.ProductProcess_BS;
import Business.Product_BS;
import Business.PurchaseDetails_BS;
import Business.PurchaseProcess_BS;
import Business.Purchase_BS;
import Business.SupplierProcess_BS;
import Business.Supplier_BS;
import DAO.Purchase_DAO;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Vector;

import javax.swing.DefaultComboBoxModel;
import javax.swing.JOptionPane;

public class CreatePurchase extends javax.swing.JDialog {

    SupplierProcess_BS supplierBO = new SupplierProcess_BS();
    ProductProcess_BS productBO = new ProductProcess_BS();
    PurchaseDetailsTableModel detailsTableModel;
    private PurchaseDetails_BS item;
//    private PurchaseDetails purde;
    private Purchase_BS ps = new Purchase_BS();
    Vector<Product_BS> products;

    /** Creates new form CreatePurchase */
    public CreatePurchase(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        Vector<Supplier_BS> suppliers = new Vector<Supplier_BS>(supplierBO.getAllSupplier());
        cbxSupplier.setModel(new DefaultComboBoxModel(suppliers));

        products = new Vector<Product_BS>(productBO.getAllProducts());
        cbxProduct.setModel(new DefaultComboBoxModel(products));

        detailsTableModel = new PurchaseDetailsTableModel();
        tblPurchaseDetails.setModel(detailsTableModel);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        btCreatePurchase = new javax.swing.JButton();
        btClose = new javax.swing.JButton();
        lblCode1 = new javax.swing.JLabel();
        cbxSupplier = new javax.swing.JComboBox();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblPurchaseDetails = new javax.swing.JTable();
        jPanel2 = new javax.swing.JPanel();
        lblCode2 = new javax.swing.JLabel();
        cbxProduct = new javax.swing.JComboBox();
        lblCode3 = new javax.swing.JLabel();
        txtQuantity = new javax.swing.JTextField();
        btAddProductItems = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        lblPaid = new javax.swing.JLabel();
        lblTotal = new javax.swing.JLabel();
        lblTotalPrice = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        txtPaid = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        btPay = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        txtUnpaid = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        btRemove = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Create Purchase");

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Create Purchase", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.TOP, new java.awt.Font("Monotype Corsiva", 1, 36), new java.awt.Color(51, 102, 0))); // NOI18N

        btCreatePurchase.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Img/Add.png"))); // NOI18N
        btCreatePurchase.setText("Save");
        btCreatePurchase.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btCreatePurchaseActionPerformed(evt);
            }
        });

        btClose.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Img/No.png"))); // NOI18N
        btClose.setText("Close");
        btClose.setActionCommand("buttton1");
        btClose.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btCloseActionPerformed(evt);
            }
        });

        lblCode1.setFont(new java.awt.Font("Tahoma", 1, 11));
        lblCode1.setText("Supplier ");

        cbxSupplier.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        cbxSupplier.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cbxSupplierActionPerformed(evt);
            }
        });

        tblPurchaseDetails.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        tblPurchaseDetails.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tblPurchaseDetailsMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tblPurchaseDetails);

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder("Add Product")));

        lblCode2.setFont(new java.awt.Font("Tahoma", 1, 11));
        lblCode2.setText("Product");

        cbxProduct.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        lblCode3.setFont(new java.awt.Font("Tahoma", 1, 11));
        lblCode3.setText("Quantity");

        btAddProductItems.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Img/Add.png"))); // NOI18N
        btAddProductItems.setText("Add");
        btAddProductItems.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btAddProductItemsActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lblCode2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(cbxProduct, javax.swing.GroupLayout.PREFERRED_SIZE, 233, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lblCode3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtQuantity, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btAddProductItems)
                .addContainerGap(34, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(cbxProduct, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(lblCode2)
                .addComponent(txtQuantity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(lblCode3)
                .addComponent(btAddProductItems))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Pay"));

        lblPaid.setFont(new java.awt.Font("Tahoma", 1, 11));
        lblPaid.setText("Paid : ");

        lblTotal.setFont(new java.awt.Font("Tahoma", 1, 11));
        lblTotal.setText("Total : ");

        lblTotalPrice.setText("0");

        jLabel1.setText("$");

        txtPaid.setText("0");

        jLabel2.setText("$");

        btPay.setText("Pay");
        btPay.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btPayActionPerformed(evt);
            }
        });

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel3.setText(" Unpaid : ");

        txtUnpaid.setText("0");

        jLabel4.setText("$");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(47, 47, 47)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(lblPaid)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtPaid, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel2)
                        .addGap(55, 55, 55)
                        .addComponent(btPay)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 65, Short.MAX_VALUE)
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtUnpaid)
                        .addGap(65, 65, 65)
                        .addComponent(jLabel4)
                        .addGap(32, 32, 32))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(lblTotal)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblTotalPrice)
                        .addGap(67, 67, 67)
                        .addComponent(jLabel1)
                        .addContainerGap())))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblTotal)
                    .addComponent(lblTotalPrice)
                    .addComponent(jLabel1))
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblPaid)
                    .addComponent(txtPaid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2)
                    .addComponent(jLabel4)
                    .addComponent(jLabel3)
                    .addComponent(txtUnpaid)
                    .addComponent(btPay))
                .addContainerGap(13, Short.MAX_VALUE))
        );

        btRemove.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Img/Button-Delete-icon.png"))); // NOI18N
        btRemove.setText("Remove");
        btRemove.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btRemoveActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(lblCode1)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(cbxSupplier, javax.swing.GroupLayout.PREFERRED_SIZE, 218, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(403, 403, 403))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                            .addComponent(btCreatePurchase)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(btClose, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(165, 165, 165))
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addContainerGap())
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGap(113, 113, 113)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(btRemove)
                        .addGap(172, 172, 172))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblCode1)
                    .addComponent(cbxSupplier, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE)
                .addComponent(btRemove)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btClose)
                    .addComponent(btCreatePurchase)))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 605, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    @SuppressWarnings("empty-statement")
    private void btCreatePurchaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btCreatePurchaseActionPerformed

        PurchaseProcess_BS pp1 = PurchaseProcess_BS.getPurchase();

        Date today = new Date();
        SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy");
        if (txtQuantity.getText().trim().equals("")){
            JOptionPane.showMessageDialog(this, "Please enter quantity","Error",JOptionPane.ERROR_MESSAGE);
            return;
        }
        if(tblPurchaseDetails.getRowCount() == 0)
        {
            JOptionPane.showMessageDialog(this, "Please add product","Error",JOptionPane.ERROR_MESSAGE);
            return;
        }

        String pcDate = format.format(today.getTime());

        Supplier_BS supplier = (Supplier_BS) cbxSupplier.getSelectedItem();
        int id = supplier.getsID();
        float paid=0;
         paid = Float.valueOf(txtPaid.getText().trim()).floatValue();
        float unpaid = Float.valueOf(txtUnpaid.getText().trim()).floatValue();

        ps = new Purchase_BS(id, paid, unpaid, pcDate);
        int newId = pp1.addPurchase(ps);

        int row = (int)tblPurchaseDetails.getRowCount();
        for(int i=0; i<row; i++)
        {
            Integer pid=(Integer)tblPurchaseDetails.getValueAt(i, 0) ;
            Float price= (Float)tblPurchaseDetails.getValueAt(i, 2);
            Integer quantity= (Integer)tblPurchaseDetails.getValueAt(i, 3);

            Purchase_BS ps2= new Purchase_BS(newId,pid, price , quantity,pcDate);
            pp1.addPurchaseDetails(ps2);
        }
        this.dispose();
    }//GEN-LAST:event_btCreatePurchaseActionPerformed

    private void btCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btCloseActionPerformed
        // TODO add your handling code here:
        this.dispose();
    }//GEN-LAST:event_btCloseActionPerformed

    private void btAddProductItemsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btAddProductItemsActionPerformed
        // TODO add your handling code here:
        if (txtQuantity.getText().trim().equals("")){
            JOptionPane.showMessageDialog(this, "Please enter quantity");
        }
        Product_BS product = (Product_BS) cbxProduct.getSelectedItem();
        int qua = 0;
        int quantity = Integer.parseInt(txtQuantity.getText());
        if (item == null) {
            item = new PurchaseDetails_BS(product.getpCode(), product.getpName(), product.getpPrice(), quantity);
        } else {
            if (product.getpName().equals(item.getProductName().trim())) {
                qua = item.getQuantity() + quantity;
                item.setQuantity(qua);
           
            } else {
                item = new PurchaseDetails_BS(product.getpCode(), product.getpName(), product.getpPrice(), quantity);
               
            }
        }
        detailsTableModel.addPurchaseItem(item);
        
        float totalPrice=0;
        float unpaid=totalPrice;
        int row= tblPurchaseDetails.getRowCount();
        for(int i=0; i<row; i++)
        {
             Float subPrice= (Float)tblPurchaseDetails.getValueAt(i,4);

            totalPrice += subPrice;
            unpaid = totalPrice;
        }
        ps.setTotal(totalPrice);
        ps.setUnpaid(Float.valueOf(txtUnpaid.getText()));
        txtUnpaid.setText(String.valueOf(unpaid));
        lblTotalPrice.setText(String.valueOf(totalPrice));
    }//GEN-LAST:event_btAddProductItemsActionPerformed

    private void cbxSupplierActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbxSupplierActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_cbxSupplierActionPerformed

    private void btRemoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btRemoveActionPerformed
        // TODO add your handling code here:
        float total= ps.getTotal();
        int row = tblPurchaseDetails.getSelectedRow();
        Float s= (Float)tblPurchaseDetails.getValueAt(row,4);
        if (JOptionPane.showConfirmDialog(this, "Are you sure you want to delete this product?")
                == JOptionPane.YES_OPTION) {
            
            PurchaseDetails_BS purchaseDetails = getProductPurchaseAtRow(row);
            Purchase_DAO.remove(purchaseDetails.getProductId());

            ((PurchaseDetailsTableModel) tblPurchaseDetails.getModel()).removePurchase(purchaseDetails);

            total -= s;
            ps.setTotal(total);
            lblTotalPrice.setText(String.valueOf(total));
        }

    }//GEN-LAST:event_btRemoveActionPerformed

    private void btPayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btPayActionPerformed
        // TODO add your handling code here:
        float paid = Float.valueOf(txtPaid.getText().trim()).floatValue();
        float totalPrice= ps.getTotal();
        float unpaid= ps.getUnpaid();
        if(paid !=0)
        {
            if(paid > totalPrice) {
                JOptionPane.showMessageDialog(this,"Paid Extra Money : " +(paid - totalPrice)+ " $");
                unpaid = 0;
                ps.setPaid(totalPrice);
                ps.setUnpaid(unpaid);
            } else{
                 unpaid = totalPrice - paid;
                 ps.setPaid(paid);
                 ps.setUnpaid(unpaid);
            }
        }
        else
        {
            unpaid= totalPrice;
            ps.setPaid(paid);
            ps.setUnpaid(unpaid);
        }

        txtUnpaid.setText(String.valueOf(unpaid));
    }//GEN-LAST:event_btPayActionPerformed

    private void tblPurchaseDetailsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblPurchaseDetailsMouseClicked

        if (evt.getClickCount() > 1) {
            int row = tblPurchaseDetails.getSelectedRow();
        }
    }//GEN-LAST:event_tblPurchaseDetailsMouseClicked
 private PurchaseDetails_BS getProductPurchaseAtRow(int rowIndex) {
        PurchaseDetailsTableModel model = (PurchaseDetailsTableModel) tblPurchaseDetails.getModel();
        return model.getProduct(rowIndex);
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btAddProductItems;
    private javax.swing.JButton btClose;
    private javax.swing.JButton btCreatePurchase;
    private javax.swing.JButton btPay;
    private javax.swing.JButton btRemove;
    private javax.swing.JComboBox cbxProduct;
    private javax.swing.JComboBox cbxSupplier;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lblCode1;
    private javax.swing.JLabel lblCode2;
    private javax.swing.JLabel lblCode3;
    private javax.swing.JLabel lblPaid;
    private javax.swing.JLabel lblTotal;
    private javax.swing.JLabel lblTotalPrice;
    private javax.swing.JTable tblPurchaseDetails;
    private javax.swing.JTextField txtPaid;
    private javax.swing.JTextField txtQuantity;
    private javax.swing.JLabel txtUnpaid;
    // End of variables declaration//GEN-END:variables
}
